from django.shortcuts import render


# Create your views here.
def login(request):
    return render(request, 'login.html')


def signin(request):
    if request.method == 'POST':
        email = request.POST.get('email')
        password = request.POST.get('password')
        if email == 'admin' and password == 'admin':
            return render(request, 'dashboard.html')
        else:
            return render(request, 'login.html', {'error': '用户名或密码错误'})
    return render(request, 'login.html')


def index(request):
    return render(request, 'dashboard.html')


def about(request):
    return render(request, 'about.html')
